function [outputArg1] = mkfigtwo(xdates,estbeta,estvcov,textsize,altbeta); 
%UNTITLED Summary of this function goes here
%   Detailed explanation goes here
outputArg1 = figure;

cigrey = [0.85 0.85 0.85];


yearticks = [2000 2010 2020];
%figure(1)
subplot(2,3,1)
zx = 2;
  plot(xdates,estbeta(:,zx))
  
lwbnd = [xdates estbeta(:,zx)-squeeze(2*sqrt(estvcov(zx-1,zx-1,:))) ];
upbnd = [xdates estbeta(:,zx)+squeeze(2*sqrt(estvcov(zx-1,zx-1,:)))];
cipatch = [lwbnd;upbnd(end:-1:1,:)];

if nargin == 5;
     plot(xdates,altbeta(:,zx),'r*','markersize',8)
end;

patch(cipatch(:,1),cipatch(:,2),cigrey)
hold on
plot(xdates,estbeta(:,zx),'g-','linewidth',2.75,'color',[7,60,101]/255)
oneline = ones(length(xdates),1);
plot(xdates,oneline(:),'--','color',[.5,.5,.5])
if nargin == 5;
     plot(xdates,altbeta(:,zx),'r*','markersize',8)
end;

axis tight;
vaxis =   axis;
axis([xdates(1)  xdates(end)+365 vaxis(3:4)])  

set(gca,'xtick',datenum(yearticks,6,30), 'Layer', 'top')
datetick('x','keeplimits','keepticks')

if zx > 0;
  
    vaxis = axis;

end

set(gca,'Fontsize',16)
title('$\phi_{\tau}$','fontsize',textsize,'Interpreter','latex')
   
%orient landscape
%print -dpdf newfigures/estmodel_mu_phi_2016

subplot(2,3,2)
zx = 3;
  plot(xdates,estbeta(:,zx))
  if nargin ==  5;
     plot(xdates,altbeta(:,zx),'r*','markersize',8)
end;

  
lwbnd = [xdates estbeta(:,zx)-squeeze(2*estbeta(:,zx).*sqrt(estvcov(zx-1,zx-1,:))) ];
upbnd = [xdates estbeta(:,zx)+squeeze(2*estbeta(:,zx).*sqrt(estvcov(zx-1,zx-1,:)))];
cipatch = [lwbnd;upbnd(end:-1:1,:)];
patch(cipatch(:,1),cipatch(:,2),cigrey)
hold on
plot(xdates,estbeta(:,zx),'linewidth',2.75,'color',[7,60,101]/255)
 if nargin ==  5;
     plot(xdates,altbeta(:,zx),'r*','markersize',8)
end;
axis tight;
vaxis = axis;
axis([xdates(1)  xdates(end)+365 vaxis(3:4)])  
set(gca,'xtick',datenum(yearticks,6,30), 'Layer', 'top')
datetick('x','keeplimits','keepticks')

if zx > 2;
  
    vaxis = axis;
    axis([vaxis(1:2) 0 0.25]);

end

set(gca,'Fontsize',textsize)
title('$\sigma_p$','fontsize',textsize,'Interpreter','latex')

subplot(2,3,3)
zx = 4;
  plot(xdates,estbeta(:,zx))
  if nargin == 5;
     plot(xdates,altbeta(:,zx),'r*','markersize',8)
end;
  
lwbnd = [xdates estbeta(:,zx)-squeeze(2*estbeta(:,zx).*sqrt(estvcov(zx-1,zx-1,:))) ];
upbnd = [xdates estbeta(:,zx)+squeeze(2*estbeta(:,zx).*sqrt(estvcov(zx-1,zx-1,:)))];
cipatch = [lwbnd;upbnd(end:-1:1,:)];
patch(cipatch(:,1),cipatch(:,2),cigrey)
hold on
plot(xdates,estbeta(:,zx),'g-','linewidth',2.75,'color',[7,60,101]/255)
if nargin == 5;
     plot(xdates,altbeta(:,zx),'r*','markersize',8)
end;
axis tight;
vaxis =   axis;
axis([xdates(1)  xdates(end)+365 vaxis(3:4)])  

set(gca,'xtick',datenum(yearticks,6,30), 'Layer', 'top')
datetick('x','keeplimits','keepticks')

if zx > 2;
  
    vaxis = axis;
    axis([vaxis(1:2) 0 0.25]);

end

set(gca,'Fontsize',16)
title('$\sigma_{\tau}$','fontsize',textsize,'Interpreter','latex')

orient landscape
%print -dpdf -bestfit newfigures/estmodel_rhosigmas_July2017



end

